package com.woniuxy.controller;

import com.woniuxy.pojo.vo.RoleUserVO;
import com.woniuxy.service.SysRoleUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("roleUser")
public class SystemRoleUserController {
    @Autowired
    SysRoleUserService sysRoleUserService;
    //查询角色下的用户
    @GetMapping("/getRoleUser/{roleId}")
    public ResponseEntity<?> getRoleUser(@PathVariable Integer roleId){
        List<RoleUserVO> roleUserVOS  = sysRoleUserService.getRoleUser(roleId);
        return ResponseEntity.ok(roleUserVOS);
    }
}
